package com.cari.oa.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;


@Entity
@Table(name = "T_NOTIFICATION")
public class NotificationEntity implements Serializable{

	private static final long serialVersionUID = 4067812845915799213L;
	
	@Id
    @Length(max = 32)
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    private String id;
	
	@NotNull(message = "标题不能为空")
    @Length(max = 50, message = "标题长度要小于50个字符")
    private String title;                 //标题
	
	@Length(max = 500, message = "标题长度要小于500个字符")
	@NotNull(message = "内容不能为空")
    private String content;               //内容
	
	@NotNull(message = "创建时间不能为空")
    @Column(name = "CREATE_TIME")
    private Date createTime = new Date(); //创建时间
	
    @Column(name = "FROM_USER")
    private String fromUser;              //发送人
	
	@NotNull(message = "接收人")
    @Column(name = "TO_USER")
    private String toUser;                //接收人
	
    @Column(name = "ISREAD")              //是否阅读
	private Integer isRead;
    
    @Column(name = "TO_USERCNNAME")
    private String toUserCnname;
    
    @Column(name = "FROM_USRECNNAME")
    private String fromUserCnname;        //发送者中文名
    
    public NotificationEntity(){}
    
	public NotificationEntity( String title, String content,
		 String fromUser, String fromUserCnname, String toUser,String toUserCnname, Integer isRead) {

		this.fromUserCnname = fromUserCnname;
		this.toUserCnname = toUserCnname;
		this.title = title;
		this.content = content;
		this.fromUser = fromUser;
		this.toUser = toUser;
		this.isRead = isRead;
	}
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getFromUser() {
		return fromUser;
	}

	public void setFromUser(String fromUser) {
		this.fromUser = fromUser;
	}

	public String getToUser() {
		return toUser;
	}

	public void setToUser(String toUser) {
		this.toUser = toUser;
	}

	public Integer getIsRead() {
		return isRead;
	}

	public void setIsRead(Integer isRead) {
		this.isRead = isRead;
	}

	public String getToUserCnname() {
		return toUserCnname;
	}

	public void setToUserCnname(String toUserCnname) {
		this.toUserCnname = toUserCnname;
	}

	public String getFromUserCnname() {
		return fromUserCnname;
	}

	public void setFromUserCnname(String fromUserCnname) {
		this.fromUserCnname = fromUserCnname;
	}
}
